package com.zmcc.service.impl;

import com.google.gson.Gson;
import com.zmcc.entity.MobileVerifyTemplate;
import com.zmcc.entity.common.CommonRequest;
import com.zmcc.service.IMobileVerifyRequest;

/**
 * @program: saashelper
 * @description:
 * @author: lin
 * @create: 2019-12-19 17:43
 **/
public class MobileVerifyCommercial implements IMobileVerifyRequest {
    private final static String url = "https://dev.cmccopen.cn/api";

    private static MobileVerifyCommercial mobileVerifyCommercial;

    public static synchronized MobileVerifyCommercial getInstance() {
        if (mobileVerifyCommercial == null) {
            mobileVerifyCommercial = new MobileVerifyCommercial();
        }
        return mobileVerifyCommercial;
    }

    @Override
    public CommonRequest getMobileVerifyRequest(MobileVerifyTemplate template) {
        CommonRequest request = new CommonRequest();
        request.setUrl(url+"/v1"+"/uniauth" +"/localNumberCheck");
        request.setBody(new Gson().toJson(template));
        return request;
    }
}
